package com.macro.mall.portal.controller;

import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.BmsFun;
import com.macro.mall.portal.dto.BmsFunParam;
import com.macro.mall.portal.service.BmsFunService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 添加浙东
 * Created 2024/8/10.
 *
 */
@Controller
@Api(tags = "BmsFun")
@Tag(name = "BmsFun", description = "浙东趣事")
@RequestMapping("/bmsFunMp")
public class BmsFunController {
    
    @Autowired
    private BmsFunService bmsFunService;
    @ApiOperation("分页浙东趣事")
    @RequestMapping(value = "/mpList", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<CommonPage<BmsFun>> getList(@RequestBody BmsFunParam bmsFunParam) {
        List<BmsFun> bmsFunList = bmsFunService.getList(bmsFunParam);
        return CommonResult.success(CommonPage.restPage(bmsFunList));
    }
    
    @ApiOperation("根据id获取浙东趣事")
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<BmsFun> getItem(@PathVariable Long id) {
        BmsFun bmsFun = bmsFunService.getItem(id);
        return CommonResult.success(bmsFun);
    }

}
